﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace XinLife.Model
{
    public class ServiceMappingProfile : Profile
    {
        public ServiceMappingProfile()
        {
            CreateMap<Module, ModulePageOutputDto>();
            CreateMap<RoleAuthInputDto, Role>();
            CreateMap<UserInputDto, User>().ForMember(t => t.Roles, opt => opt.Ignore());
            CreateMap<Module, ModuleButton>().ForMember(dest => dest.cModuleId, opt => opt.MapFrom(src => src.cParentId)).ForMember(dest => dest.cModuleName, opt => opt.MapFrom(src => src.cName));
        }
    }
}
